# Maintainer: kpcyrd <kpcyrd[at]archlinux[dot]org>

pkgname=progpick
pkgver=0.2.0
pkgrel=1
pkgdesc='Bruteforce with a stream of permutations of a specific pattern'
url='https://github.com/kpcyrd/progpick'
arch=('loong64' 'x86_64')
license=('GPL3')
makedepends=('cargo' 'scdoc')
source=(https://github.com/kpcyrd/${pkgname}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz
        https://github.com/kpcyrd/${pkgname}/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.gz.asc)
b2sums=('7b45f66a8ef297ce2f20e561bd8689cda0c38bfdfcb909c0fd2e0643dfac5933fca59b33327d7135d7eb255bd66f7e49bacfd30ed1d2a7aa1ab79aa37e95fb89'
        'SKIP')
validpgpkeys=("64B13F7117D6E07D661BBCE0FE763A64F5E54FD6")

prepare() {
  cd "${pkgname}-${pkgver}"
  cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
  cd ${pkgname}-${pkgver}
  cargo build --frozen --release
  make docs
}

check() {
  cd ${pkgname}-${pkgver}
  cargo test --frozen --release
}

package() {
  cd ${pkgname}-${pkgver}
  install -Dm 755 target/release/${pkgname} -t "${pkgdir}/usr/bin"
  install -Dm 644 contrib/${pkgname}.1 -t "${pkgdir}/usr/share/man/man1"
}

# vim: ts=2 sw=2 et:
